]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
power: Move the Power Off indicator to the power menu
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 17 Jun 2013 22:19:20 +0000 (18:19 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 13 Aug 2013 10:50:24 +0000 (06:50 -0400)
It's only supposed to show if we have a battery, and hooking into
the power system is the easiest way of making that happen.

https://bugzilla.gnome.org/show_bug.cgi?id=705845

js/ui/panel.js
js/ui/status/power.js
js/ui/status/system.js

index 289a90b3d4e6b10da0f2b490d1c75043518fff9b..16e8b6ad91593e5f9ae06f3beab02b294e34c4d7 100644 (file)
@@ -858,9 +858,8 @@ const AggregateMenu = new Lang.Class({
 
         this._indicators.add_child(this._network.indicators);
         this._indicators.add_child(this._bluetooth.indicators);
-        this._indicators.add_child(this._power.indicators);
         this._indicators.add_child(this._volume.indicators);
-        this._indicators.add_child(this._system.indicators);
+        this._indicators.add_child(this._power.indicators);
         this._indicators.add_child(new St.Label({ text: '\u25BE',
                                                   y_expand: true,
                                                   y_align: Clutter.ActorAlign.CENTER }));
index f38c0bb3da7028ede8c2934800df202965f6f80b..bfbc40d809f18af4b2c4a505962c9a5062684f70 100644 (file)
@@ -109,10 +109,10 @@ const Indicator = new Lang.Class({
         if (icon) {
             let gicon = Gio.icon_new_for_string(icon);
             this._indicator.gicon = gicon;
-            this._indicator.show();
             this._item.icon.gicon = gicon;
         } else {
-            this._indicator.hide();
+            // If there's no battery, then we use the power icon.
+            this._indicator.icon_name = 'system-shutdown-symbolic';
         }
     },
 
index 74ab786d9ba588d22ff05a2066e69a52492c70d9..a6ad411ffb0cc265072df767f7b1c8926e44f4fb 100644 (file)
@@ -47,8 +47,6 @@ const Indicator = new Lang.Class({
     _init: function() {
         this.parent();
 
-        this._indicator = this.addIndicator(new Gio.ThemedIcon({ name: 'system-shutdown-symbolic' }));
-
         this._screenSaverSettings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA });
         this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });
         this._privacySettings = new Gio.Settings({ schema: PRIVACY_SCHEMA });